<template>
  <div class="blog">
      <div class="land">

        <div class="contain">
          <div class="brief">
              <h1>
              Frontrock Blogs
              </h1>
              Learn real estate and blockchain investments, discover new perspectives, and read the latest updates from Frontrock. 
              <div class="search">
                  <el-autocomplete prefix-icon="el-icon-search" v-model="state" :fetch-suggestions="querySearchAsync"
                  placeholder="Search our article" @select="handleSelect" size="medium"></el-autocomplete>
                  <div class="buttons">
                      <a href="javascript:;" class="start">Search</a>
                  </div>
              </div>
          </div>
          <div class="cloud">
          </div>
        </div>

        <div class="article">
          <div class="arc" @click="openArticle('1')">
            <div class="bg"></div>
            <div class="cell buttons">
              <a href="javascript:;" class="pros start">Prospective</a>
              <p>Blockchain-Enabled Applications: Myth or It’s About time?</p>
              <span>Wesley Xia - April 9, 2021</span>
            </div>
          </div>
          <div class="arc" @click="openArticle('2')">
            <div class="bg"></div>
            <div class="cell buttons">
              <a href="javascript:;" class="pros start">Prospective</a>
              <p>Blockchain-Enabled Applications: Myth or It’s About time?</p>
              <span>Wesley Xia - April 9, 2021</span>
            </div>
          </div>
        </div>

      </div>
  </div>
</template>

<script>
//   import tokensCard from './tokensCard'
export default {
    data() {
      return {
        articles: [],
        state: '',
        timeout:  null
      }
    },
    components: {
    //   tokensCard
    },
    mounted() {
        console.log('blog:', this)
        this.articles = this.loadQueryList()
    },
    methods: {
        routePath(i) {
            Bus.$emit('topbar', i)
        },
        salesBuy() {
            console.log(Date());
        },
        openArticle(id) {
          // Bus.$emit('topbar', 12)
          window.open(`./#/article?id=${id}`)
        },
        loadQueryList() {
            return [
            { "value": "Blockchain-Enabled1", "id": "11" },
            { "value": "Blockchain-Enabled2", "id": "22" }
            ]
        },
        querySearchAsync(queryString, cb) {
            var articles = this.articles;
            var results = queryString ? articles.filter(this.createStateFilter(queryString)) : articles

            clearTimeout(this.timeout);
                this.timeout = setTimeout(() => {
                cb(results);
            }, 3000 * Math.random())
        },
        createStateFilter(queryString) {
            return (state) => {
                return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
            }
        },
        handleSelect(item) {
            console.log(item)
        }
    }
}
</script>


<style scoped="scoped" lang="scss">
  .blog {
    position: relative;
    text-align: center;
    // min-height: 400px;
    // margin: 50px auto 0 auto;
    // background: #EF6566;
    color: #fff;
    .land{
      font-family: Newsreader, serif;
      width: 100%;
      display: inline-block;
      .contain{
        // height: 660px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: left;
        @media screen and (max-width: 720px) {
          // height: 360px;
          padding-bottom: 100px;
          flex-direction: column-reverse;
        }
        .brief{
            width: 30%;
            font-size: 16px;
            line-height: 22px;
            h1{
              font-size: 48px;
              font-weight: 900;
              line-height: 52px;
            }
            .search{
                margin: 80px 0 0 0;
                display: flex;
                align-items: center;
                .buttons{
                    padding: 0;
                    text-align: center;
                    margin:0 0 0 -160px;
                    z-index: 100;
                    a{
                        width: 140px;
                        padding: 2px 0 14px 0;
                    }
                }
            }
            @media screen and (max-width: 720px) {
                width: 90%;
                letter-spacing:1px;
                h1{
                  font-size: 36px;
                  letter-spacing: 0;
                }
                .search{
                  margin: 10px 0 0 0;
                  .buttons{
                    display: none;
                  }
                }
            }
        }
        .cloud{
            background: url(../assets/blog_bg.png) no-repeat;
            background-size:auto 100%;
            background-position: center 50%;
            width: 56%;
            height: 500px;
            @media screen and (max-width: 720px) {
              width: 90%;
              height: 240px;
              left: -50px;
              right: -50px;
            }
        }
      }
      
      .article{
        display: flex;
        align-items: center;
        justify-content: initial;
        background: #fff;
        padding: 80px 0 160px 0;
        .arc{
          cursor: pointer;
          border-radius: 25px;
          background: url(../assets/blog_thumb.jpeg) no-repeat;
          background-size: 100% auto;
          width:45%;
          max-width: 360px;
          height: 240px;
          position: relative;
          margin:0 0px 0 80px;
          color:#070F4E;
          .cell{
            text-align: left;
            background: #fff;
            border-radius: 25px;
            position: absolute;
            transform: translateX(-50%);
            left: 50%;
            bottom: -70px;
            width: 80%;
            height: 100px;
            margin: 0;
            padding: 20px 15px 25px 15px;
            box-shadow: 0px 1px 3px rgba(0, 0, 0, .1);
            .pros{
              text-align: center;
              width: 140px;
              height: 30px;
              line-height: 25px;
              font-size: 12px;
              margin: 0;
            }
            p{
              font-weight: bold;
              font-size: 17px;
              line-height: 21px;
              margin: 10px 0 5px 0;
            }
            span{
              color:#070F4E;
              opacity: .6;
              font-size: 12px;
            }
          }
        }
        @media screen and (max-width: 720px) {
          padding: 80px 0;
          flex-direction: column;
          .arc{
            width: 95%;
            margin:0 0 100px 0;
          }
        }
      }

      .buttons{
        // width: 40%;
        padding: 80px 0;
        .start, .know-more{
          width: 240px;
          height: 40px;
          line-height: 35px;
          box-sizing: border-box;
          border: 2px solid #EF6566;
          box-shadow: 0px 2px 7px rgba(0, 0, 0, 0.2);
          border-radius: 44px;
          color: white;
          font-family: "Krona One", monospace;
          font-size: 14px;
        //   font-weight: bold;
          text-decoration: none;
          display: inline-block;
          margin: 0 8px;
          &.start{
            background: #EF6566;
            &:hover{
              filter: brightness(1.1);
            }
          }
          &.know-more{
            border:1px solid;
            &:hover{
              background: rgba(239, 101, 102, .1);
              // background: #EF6566;
              // border: 1px solid transparent;
            }
          }
          @media screen and (max-width: 640px) {
            width: 90%;
            margin:0;
          }
        }
      }
    }
  }

@media only screen and (min-width: 1680px) {
  .order{
    font-size: 16px;
    font-weight: bold;
    color:white;
    position: absolute;
    right: 2%;
    top: 28%;
    .r{
      font-size: 45px;
      em{
        font-size: 20px;
        font-style: normal;
      }
    }
    .btn {
      font-size: 22px;
    }
  }
}
@media only screen and (min-width: 1570px) and (max-width: 1680px) {
  .order{
    font-size: 16px;
    font-weight: bold;
    color:white;
    position: absolute;
    right: 2%;
    top: 28%;
    .r{
      font-size: 45px;
      em{
        font-size: 20px;
        font-style: normal;
      }
    }
    .btn {
      font-size: 22px;
    }
  }
}

@media only screen and (min-width: 1440px) and (max-width: 1570px) {
  .order{
    font-size: 14px;
    font-weight: bold;
    color:white;
    position: absolute;
    right: 3%;
    top: 36%;
    .r{
      font-size: 38px;
      em{
        font-size: 15px;
        font-style: normal;
      }
    }
    .btn {
      font-size: 21px;
    }
  }
}

@media only screen and (max-width: 1440px) {
  .order{
    font-size: 14px;
    font-weight: bold;
    color:white;
    position: absolute;
    right: 2%;
    top: 40%;
    .r{
      font-size: 30px;
      em{
        font-size: 14px;
        font-style: normal;
      }
    }
  }
}

@media only screen and (max-width: 720px) {
  .order {
    font-size: 14px;
    font-weight: bold;
    color:white;
    position: absolute;
    right: 2%;
    top: 0;
    .r {
      font-size: 30px;
      em {
        font-size: 14px;
        font-style: normal;
      }
    }
    .btn {
      font-size: 16px;
      margin-left: 1px;
    }
  }
}

@media only screen and (max-width: 420px) {
  .order {
    top: 4px;
    right: 1.5%;
    a {
      font-size: 16px;
      transform: translateY(-6px);
    }
    .r {
      font-size: 24px;
    }
    .btn {
      padding: 0.18em 0.6em 0.19em;
      font-size: 15px;
    }
  }
}
@media only screen and (max-width: 375px) {
  .order {
    top: 0px;
    right: 1.5%;
    a {
      font-size: 16px;
      transform: translateY(-6px);
    }
    .r {
      font-size: 18px;
    }
    .btn {
      padding: 0.12em 0.3em 0.13em;
      font-size: 15px;
      margin-left: 0;
    }
  }
}

@media only screen and (max-width: 360px) {
  .order {
    top: -1px;
    a {
      font-size: 16px;
      transform: translateY(-6px);
    }
    .r {
      font-size: 18px;
    }
    .btn {
      padding: 0.12em 0.3em 0.13em;
      font-size: 15px;
      margin-left: 0;
    }
  }
}
</style>


<style lang="scss">
.blog{
    .brief{
        .search{
            .el-input{
                .el-input__inner{
                    border:none;
                    height: 65px;
                    width: 600px;
                    font-size: 18px;
                    border-radius: 35px;
                    padding: 4px 0  0 60px;
                    font-family: Newsreader, serif;
                    font-weight: 100;
                }
                .el-icon-search{
                  transform: scale(1.3);
                  color: #070F4E;
                  font-weight: bold;
                  margin: 0 10px;
                }
            @media screen and (max-width: 720px) {
              // margin:-20px 0 0 0;
              position: relative;
              .el-input__inner{
                // width: 350px;
                position: absolute;
                // padding: 0;
                top:0;
                left: 0px;
                right: 10px;
                height: 45px;
                width: auto;
                min-width: 350px;
                // width: 100%;
              }
            }
            }
        }
    }
}
</style>